﻿<Window x:Class="Lithnet.Acma.Presentation.NewMappingWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation"
        xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
        xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
        xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
        Title="{Binding DisplayName}"
        Height="300"
        Width="398"
        ResizeMode="CanResize"
        ShowInTaskbar="False"
        Topmost="True"
        WindowStartupLocation="CenterScreen"
        Icon="{Binding DisplayIcon}">

    <Grid HorizontalAlignment="Left"
          Width="367">

        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.Margin>
                    <Thickness>15</Thickness>
                </Grid.Margin>

                <Label Content="Object class"
                       Grid.Row="0"
                       Grid.Column="0" />
                <TextBox Grid.Row="0"
                         Grid.Column="1"
                         Margin="2"
                         Text="{Binding Path=ObjectClassName, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true, Mode=OneTime}"
                         IsReadOnly="True" />

                <Label Content="Attribute"
                       Grid.Row="1"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Path=AllowedAttributes}"
                          SelectedItem="{Binding Path=Attribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="1"
                          Grid.Column="1" />

                <Label Content="Inherit from another attribute"
                       Grid.Row="2"
                       Grid.Column="0" />
                <CheckBox Grid.Row="2"
                          Grid.Column="1"
                          Margin="2"
                          VerticalAlignment="Center"
                          IsChecked="{Binding Path=IsInherited, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=true}" />

                <Label Content="Inheritance source"
                       Grid.Row="3"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Path=AllowedInheritanceSourceAttributes}"
                          SelectedItem="{Binding Path=InheritanceSource, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="3"
                          Grid.Column="1"
                          IsEnabled="{Binding Path=IsInherited}" />

                <Label Content="Inheritance source object class"
                       Grid.Row="4"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Path=AllowedInheritanceSourceObjects}"
                          SelectedItem="{Binding Path=InheritanceSourceObject, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="4"
                          Grid.Column="1"
                          IsEnabled="{Binding Path=IsInherited}" />
                
                <Label Content="Inherited attribute"
                       Grid.Row="5"
                       Grid.Column="0" />
                <ComboBox ItemsSource="{Binding Path=AllowedInheritedAttributes}"
                          SelectedItem="{Binding Path=InheritedAttribute, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          DisplayMemberPath="Name"
                          Margin="2"
                          Grid.Row="5"
                          Grid.Column="1"
                          IsEnabled="{Binding Path=IsInherited}" />

            </Grid>
        </StackPanel>

        <!--<ContentPresenter Grid.Row="1" DataContext="{Binding NewTransform}">
            <ContentPresenter.Resources>
                <ResourceDictionary Source="/Views/ResourceDictionaries/TransformViewDictionary.xaml" />
            </ContentPresenter.Resources>
        </ContentPresenter>-->

        <StackPanel Grid.Row="1"
                    Orientation="Horizontal"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Bottom">
            <Button Content="Create and add new"
                    MinWidth="50"
                    MinHeight="27"
                    Margin="5"
                    Command="{Binding Commands.CreateAndAddNew}"
                    IsDefault="True" />

            <Button Content="Create"
                    MinWidth="50"
                    MinHeight="27"
                    Margin="5"
                    Command="{Binding Commands.Create}" />

            <Button Content="Cancel"
                    Margin="5"
                    MinWidth="50"
                    MinHeight="27"
                    IsCancel="True" />
        </StackPanel>
    </Grid>
</Window>
